-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add BAZEL_BUILD_DIRECTORY option #54
base: master
Are you sure you want to change the base?
Add BAZEL_BUILD_DIRECTORY option #54
Conversation
It is often useful to limit the Docker build context to a specific directory to reduce the number of files sent to the daemon and speed up builds. Add a BAZEL_BUILD_DIRECTORY option to specify the directory to build the Docker image in, which does not have to be identical to the workspace root.
For backwards compatibility, default to previous behavior if no build directory is specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this PR.
Will create a new version for Pypi once your other PR is also merged.
DAZEL_DIRECTORY=$PWD | ||
|
||
# The directory to build the docker image in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well
@@ -68,9 +68,12 @@ DAZEL_DOCKERFILE="Dockerfile.dazel" # in DAZEL_DIRECTORY | |||
# The repository to pull the dazel image from. | |||
DAZEL_REPOSITORY="dazel" | |||
|
|||
# The directory to build the dazel image in. | |||
# The directory containing the bazel workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Period at the end of the line
@@ -89,9 +89,12 @@ The possible parameters to set are (with their defaults): | |||
# The repository to pull the dazel image from. | |||
DAZEL_REPOSITORY="dazel" | |||
|
|||
# The directory to build the dazel image in. | |||
# The directory containing the bazel workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
DAZEL_DIRECTORY=$PWD | ||
|
||
# The directory to build the docker image in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
@@ -113,6 +114,7 @@ def from_config(cls): | |||
dockerfile=config.get("DAZEL_DOCKERFILE", DEFAULT_LOCAL_DOCKERFILE), | |||
repository=config.get("DAZEL_REPOSITORY", DEFAULT_REMOTE_REPOSITORY), | |||
directory=config.get("DAZEL_DIRECTORY", DEFAULT_DIRECTORY), | |||
build_directory=config.get("DAZEL_BUILD_DIRECTORY", directory), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that work?
I'm not sure directory
is a valid variable here.
It is often useful to limit the Docker build context to a specific
directory to reduce the number of files sent to the daemon and speed
up builds.
Add a BAZEL_BUILD_DIRECTORY option to specify the directory to build
the Docker image in, which does not have to be identical to the
workspace root.